﻿using ETModel;
using System.Collections.Generic;
using System.Linq;

namespace ETHotfix {
	[ObjectSystem]
	public class PlayerComponentAwakeSystem : AwakeSystem<PlayersComponent>
	{
		public override void Awake(PlayersComponent self)
		{
			self.Awake();
		}
	}
	
    /// <summary>
    /// 玩家管理组件
    /// </summary>
	public class PlayersComponent : Component
	{
		public static PlayersComponent Instance { get; private set; }

		public Player MyPlayer { get; set; }
        public Unit MyUnit { get; set; }

		public void Awake()
		{
			Instance = this;
		}
		public override void Dispose()
		{
			if (this.IsDisposed)
			{
				return;
			}
			
			base.Dispose();

			Instance = null;
		}
	}
}